MatchStr "Got300" "CONNECT\0D" {assume "CONNECT" means the current baud rate}
MatchStr "27" "NO ANSWER"
MatchStr "40" "NO DIAL"
MatchStr "41" "VOICE"
MatchStr "42" "NO CARRIER"
MatchStr "26" "BUSY"
MatchStr "38" "ERROR"
!
CanBtn 18 { if cancel button hit, hangUp then exit }
Pause 30
Xmit "$ATTENTION$D~TONE~PREF~NOCW~FONE\0D"
! { jump to label #13 if match }
Wait 3600 { wait 40 seconds for CONNECT msg from modem }
IFTRIES 1 "1" {If we can't connect, try resetting the modem}
!
!
! This CCL section formerly checked for "300" through "9600" for
! no apparent reason - we do not support MNP connections and we'd
! never see that response string at this point anyway.
!
Jump "43" { else hang up phone & exit }
!
!-----------------------------------
!
-Label Got300
DsplyMsg "Step 3: Connecting at 300 bps"
SetSpeed 300
IfEq Handshake 0
SetVar bSerSpeed 300
Jump "MayReset"
!
-Label Got1200
DsplyMsg "Step 3: Connecting at 1200 bps"
SetSpeed 1200
IfEq Handshake 0
SetVar bSerSpeed 1200
Jump "MayReset"
!
-Label Got2400
DsplyMsg "Step 3: Connecting at 2400 bps"
SetSpeed 2400
IfEq Handshake 0
SetVar bSerSpeed 2400
Jump "MayReset"
!
-Label Got4800
DsplyMsg "Step 3: Connecting at 4800 bps"
SetSpeed 4800
IfEq Handshake 0
SetVar bSerSpeed 4800
Jump "MayReset"
!
-Label Got7200
DsplyMsg "Step 3: Connecting at 7200 bps"
SetSpeed 7200
IfEq Handshake 0
SetVar bSerSpeed 7200
Jump "MayReset"
!
-Label Got9600
DsplyMsg "Step 3: Connecting at 9600 bps"
SetSpeed 9600
IfEq Handshake 0
SetVar bSerSpeed 9600
Jump "MayReset"
!
-Label Got12000
DsplyMsg "Step 3: Connecting at 12000 bps"
SetSpeed 12000
Jump "NoReset"
!
-Label Got14400
DsplyMsg "Step 3: Connecting at 14400 bps"
SetSpeed 14400
Jump "NoReset"
!
-Label Got16800
DsplyMsg "Step 3: Connecting at 16800 bps"
SetSpeed 16800
Jump "NoReset"
!
-Label Got19200
DsplyMsg "Step 3: Connecting at 19200 bps"
SetSpeed 19200
Jump "NoReset"
!
-Label Got21600
DsplyMsg "Step 3: Connecting at 21600 bps"
SetSpeed 21600
Jump "NoReset"
!
-Label Got24000
DsplyMsg "Step 3: Connecting at 24000 bps"
SetSpeed 24000
Jump "NoReset"
!
-Label Got26400
DsplyMsg "Step 3: Connecting at 26400 bps"
SetSpeed 26400
Jump "NoReset"
!
-Label Got28800
DsplyMsg "Step 3: Connecting at 28800 bps"
SetSpeed 28800
Jump "NoReset"
!
-Label Got38400
DsplyMsg "Step 3: Connecting at 38400 bps"
SetSpeed 38400
Jump "NoReset"
!
-Label Got57600
DsplyMsg "Step 3: Connecting at 57600 bps"
SetSpeed 57600
Jump "NoReset"
!
!-----------------------------------
!
-Label MayReset
IfEq Handshake 1
Jump "12"
Pause 180
Xmit "+++" { Go to command state }
Pause 180
SerReset bSerSpeed 0 8 1
Wait 60
MatchStr "12" "CONNECT"
MatchStr "45" "NO CARRIER"
Xmit "$ATTENTION$O\0D" { Go back to online state }
Wait 60
Jump "12"
!
-Label NoReset
IfEq Handshake 0
Jump "44"
!
-LABEL 12 { Modem just sent 'CONNECT' message }
Pause 20
ChrDelay 20
DsplyPic 2
!
-LABEL 13 { Establishing Connection }
Pause 30
!
ClrMchStr
MatchStr "ANSTry" "UQKT1"
MatchStr "SprintTry" "UQKT2"
MatchStr "ANSTry" "ANSNet"
MatchStr "UUNetTry" "UU.NET"
MatchStr "UUNetTry" "SATURN.BBN"
MatchStr "SprintTry" "SPRINT-IP"
MatchStr "45" "NO CARRIER"
!
Wait 4800 {Try to sync up to four times}
DsplyMsg "Timed Out..."
Jump "ConnectFailure"
!
!-------------------------------
!
-LABEL ANSTry { = for term ID}
! Sending Terminal Identifier
!
ChrDelay 2
Pause 20
DsplyMsg "Step 4: Requesting network attention"
Xmit "aol\0D"
DsplyMsg "Step 5: Talking to network"
!
Jump "CheckConnected"
!
-Label UUNetTry
DsplyMsg "Step 4: Requesting network attention"
ClrMchStr
MatchStr "SendUUNetPassword" "Password"
MatchStr "45" "NO CARRIER"
Xmit "aolnet\0D"
Wait 2000
jump ConnectFailure
!
-Label SendUUNetPassword
DsplyMsg "Step 5: Talking to network"
Xmit "A0L2aNet\0D"
Jump "CheckConnected"
!
-Label SprintTry
DsplyMsg "Step 4: Requesting network attention"
ClrMchStr
MatchStr "SendSprintPassword" "Password"
MatchStr "45" "NO CARRIER"
Xmit "aol\0D"
Wait 2000
jump ConnectFailure
!
-Label SendSprintPassword
DsplyMsg "Step 5: Talking to network"
Xmit "aol\0D"
Jump "CheckConnected"
!
-Label CheckConnected
DsplyMsg "Step 6: Connecting to America Online"
ClrMchStr
MatchStr "ConnectSuccess" "CONNECTED"
MatchStr "ConnectSuccess" "OPEN"
MatchStr "ConnectFailure" "UNAVAILABLE"
MatchStr "ConnectFailure" "CONNECT FAILED"
MatchStr "ConnectFailure" "NOT AVAILABLE"
MatchStr "ConnectFailure" "UNREACHABLE"
MatchStr "ConnectFailure" "NO CONNECTION"
MatchStr "SyncFailure" "BAD PASSWORD"
MatchStr "SyncFailure" "LOGIN INVALID"
Wait 2700
jump "ConnectFailure"
!
-Label ConnectSuccess
DsplyMsg "Step 7: Checking Password"
Exit 0
!
!-----------------------------------
!
-Label 18 { User aborted sequence }
Exit -51
!
-Label 19 { User aborted sequence...dont need to hang up though}
Exit -111
!
!-----------------------------------
!
-Label 26 {Busy phone}
IfEq ~ATMP 0
DsplyMsg "The number dialed is busy. Trying second number."
Talert "The number dialed is busy. Please try again later.\0D\0DTo find another local access number, select Get Local # from the Locality pop-up menu, and click on Sign On."
IfEq ~ATMP 1
OneAlert 1 "\0D\0DFor more information, select Help from the Apple menu."
Exit -1
!
!-----------------------------------
!
!
!
-Label 27 {No Answer}
IfEq ~ATMP 0
DsplyMsg "The number dialed is not answering. Trying second number."
TAlert "The number dialed is not answering. Please try again later.\0D\0DTo find another local access number, select Get Local # from the Locality pop-up menu, and click on Sign On."
IfEq ~ATMP 1
OneAlert 1 "\0D\0DFor more information, select Help from the Apple menu."
Exit -1
!
!---------------------------------------------
!
-Label 28
Talert "The access company failed to respond. Please try again later.\0D\0DTo find another local access number, select Get Local # from the Locality pop-up menu, and click on Sign On."
IfEq ~ATMP 1
OneAlert 1 "\0D\0DFor more information, select Help from the Apple menu."
Exit -1
!
!-----------------------------------
!
-Label ConnectFailure {not_avail}
TAlert "The final connection step to ~APPL did not complete. Please try again later."
Jump "36"
!
!-----------------------------------
!
-Label SyncFailure {CCL Sync problem}
TAlert "An error has occured while attempting to connect to America Online.\0D\Normally, trying again will resolve this problem."
Jump "36"
!
!-----------------------------------
!
-Label 33 {no response from modem}
TAlert "~APPL was unable to initialize your modem.\0D\0D1. Turn your modem off, then back on.\0D2. Check your modem cable connections.\0D"
IfEq ~ATMP 1
OneAlert 1 "3 Click on Setup, and verify your modem type selection.\0D\0DFor more information, select Help from the Apple menu."
Exit -1
!
!-----------------------------------
!
-Label 35
Exit -1
!
-Label 36
IfEq ~ATMP 1
OneAlert 1 "\0D\0DFor more information, select Help from the Apple menu."
Exit -1
!-----------------------------------
! Some new error messages since error #1 is getting kind of meaningless.
-Label 37 { Time-Out }
TAlert "It has taken too long to process your connection.\0D\0D1. Test your modem with another communications program.\0D2. Verify the local access number by selecting Get Local # "
IfEq ~ATMP 1
OneAlert 1 "from the Locality pop-up menu, then clicking on Sign On.\0D\0DFor more information, select Help from the Apple menu."
Exit -1
-Label 38 {Modem command error}
TAlert "Your modem is not accepting our commands.\0D\0D1. Turn your modem off, then back on.\0D2. Click on Setup, and verify your modem type selection."
Jump "36"
!
-Label 40
TAlert "The modem has reported no dial tone.\0D1. Check the phone line connections.\0D2. Make sure the line from the wall is connected to the jack labeled Line, Telco, Wall, or Jack.\0D"
IfEq ~ATMP 1
OneAlert 1 "3. Use a telephone to check for a dial tone.\0D\0DFor more information, select Help from the Apple menu."
Exit -1
!
-Label 41
TAlert "The number dialed did not connect to the access company.\0D\0D1. Verify your setup information by clicking on Setup.\0D2. Verify the local access number by selecting Get Local # "
IfEq ~ATMP 1
OneAlert 1 "from the Locality pop-up menu, then clicking on Sign On.\0D\0DFor more information, select Help from the Apple menu."
Exit -1
!
-Label 42
TAlert "The modem was unable to get a carrier signal.\0D\0D1. Verify your setup information by clicking on Setup.\0D2. Verify the local access number by selecting Get Local # "
IfEq ~ATMP 1
OneAlert 1 "from the Locality pop-up menu, then clicking on Sign On.\0D\0DFor more information, select Help from the Apple menu."
Exit -1
!
-Label 43
TAlert "The modem detected a timeout.\0D\0D1. Test your modem with another communications program.\0D2. Verify the local access number by selecting Get Local # "
IfEq ~ATMP 1
OneAlert 1 "from the Locality pop-up menu, then clicking on Sign On.\0D\0DFor more information, select Help from the Apple menu."
Exit -1
!
-Label 44
OneAlert 1 "Connection speeds above 9600 bps require the use of Hardware Handshaking."
Exit -1
!
-Label 45
OneAlert 1 "The modem has lost carrier signal. Please try signing on again."
Exit -1
!
!------------------------------------
-Label CheckPhoneLength
!
NewString sPhoneNumber
SetVar sPhoneNumber ~FONE
NewLngInt lCount
SetVar lCount 6
!
-Label TopPhoneLoop
IfEq lCount 0
Jump "FinishPhoneLength"
DecVar sPhoneNumber
DecVar lCount
Jump "TopPhoneLoop"
!
-Label FinishPhoneLength
IfEq sPhoneNumber ""
Jump "EmptyPhone"
Return
!
-Label EmptyPhone
OneAlert 1 "You must enter phone numbers before signing on.\0D\0DSelect ""Setup"" and verify the phone numbers you have entered."
Exit -111
!------------------------------------
!
*-Label 0 {Hangup Sequence}
*CanBtn 2
!
*Flush
!
*SetTries 0 {DMC: see if we can get the modem's attention}
*ClrMchStr
*MatchStr "1" "OK" { Dont look for an echo, may be a}
*MatchStr "1" "NO" { false echo. Any type of match is good}
*MatchStr "1" ">" { Special case for Avatex 1200 modems}
!
*Pause 180 { Pause for 3 sec min gap }
*Xmit "+++" { Get the modems attention}
*Pause 180 { Pause for 3 sec min gap }
*IfTries 0 "1"
!
*ClrMchStr
*MatchStr "1" "OK"
*MatchStr "2" "CARRIER" {Any type of match is good}
*MatchStr "1" ">" { Special case for Avatex 1200 modems}
!
*Pause 180 { Pause for 3 sec min gap }
*Xmit "+++" { Get the modems attention}
*Pause 180 { Pause for 3 sec min gap }
!
*-Label 1
*IncTries
*ClrMchStr
*MatchStr "2" "ERROR"
*MatchStr "2" "OK"
*MatchStr "2" "CARRIER"
*MatchStr "2" ">" { Special case for Avatex 1200 modems}
!
*Pause 40
*Xmit "$ATTENTION$H\0D"
*Wait 300
!
*-Label 2
*Pause 40 { Allow modem to settle between commands.}